package com.alex.utils.html.element;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ContainerTag extends Tag {

	private List<Element> childs;
	
	public ContainerTag(String name) {
		super(name);
	}

	@SuppressWarnings("unchecked")
	public List<Element> getChilds() {
		return childs != null ? childs : Collections.EMPTY_LIST;
	}
	
	public void addChild(Element element) {
		if (childs == null) {
			childs = new ArrayList<Element>();
		}
		childs.add(element);
	}
}
